package io.finer.erp.jeecg.bas.service.impl;

import io.finer.erp.jeecg.bas.dto.PfMaterialDTO;
import io.finer.erp.jeecg.bas.entity.BasPfMaterial;
import io.finer.erp.jeecg.bas.mapper.BasPfMaterialMapper;
import io.finer.erp.jeecg.bas.service.IBasPfMaterialService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 产品配方详情表
 * @Author: jeecg-boot
 * @Date:   2020-10-19
 * @Version: V1.0
 */
@Service
public class BasPfMaterialServiceImpl extends ServiceImpl<BasPfMaterialMapper, BasPfMaterial> implements IBasPfMaterialService {
	
	@Autowired
	private BasPfMaterialMapper basPfMaterialMapper;
	
	@Override
	public List<BasPfMaterial> selectByMainId(String mainId) {
		return basPfMaterialMapper.selectByMainId(mainId);
	}

	@Override
	public Result<List<PfMaterialDTO>> getPfInfo(String pfId) {
		// TODO Auto-generated method stub
		List<PfMaterialDTO> list = basPfMaterialMapper.getPfInfo(pfId);
		Result<List<PfMaterialDTO>> result = new Result<>();
		result.setResult(list);
		result.setSuccess(true);
		result.setCode(CommonConstant.SC_OK_200);
		return result;
	}
}
